package com.woniuxy.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.math.BigDecimal;
/**
 * @Author: 马宇航
 * @Todo: TODO
 * @DateTime: 25/08/07/星期四 14:25
 * @Component: 成都蜗牛学苑
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(indexName = "woniumall")
public class Goods {
    @Id
    //keyword类型：不进行分词，直接存储
    @Field(name="id", type = FieldType.Keyword)
    private String id;
    //text类型：进行分词，存储分词后的结果
    @Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_smart")
    private String name;
    @Field(type = FieldType.Text)
    private String goodsno;
    @Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_smart")
    private String publisher;
    @Field
    private String pubtime;
    @Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_smart")
    private String description;
    @Field
    private BigDecimal salesprice;
    @Field
    private int salenums;
}
